namespace Collection.DbEntities
{
    using System;


    /// <summary>
    /// 表名：co_Merchandise 主键列：Id,CatalogId
    /// </summary>
    [SerializableAttribute()]
    public partial class _Merchandise : MySoft.Data.Entity
    {

        protected Int64 _Id;

        protected Int64 _CatalogId;

        protected Int64 _ProductId;

        protected String _Properties;

        protected Decimal _CommissionRate;

        protected String _Title;

        protected String _Nick;

        protected String _Picture;

        protected Decimal _Price;

        protected String _ClickUrl;

        protected Decimal _Commission;

        protected Int64 _CommissionCount;

        protected Decimal _CommissionVolume;

        protected String _ShopClickUrl;

        protected Int32 _SellerCreditScore;

        protected String _ItemLocation;

        protected Int32 _Volume;

        protected DateTime _Modified;

        protected DateTime _ListTime;

        protected DateTime _DelistTime;

        protected DateTime _AddTime;

        protected DateTime _UpdateTime;

        public Int64 Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this.OnPropertyValueChange(_.Id, _Id, value);
                this._Id = value;
            }
        }

        public Int64 CatalogId
        {
            get
            {
                return this._CatalogId;
            }
            set
            {
                this.OnPropertyValueChange(_.CatalogId, _CatalogId, value);
                this._CatalogId = value;
            }
        }

        public Int64 ProductId
        {
            get
            {
                return this._ProductId;
            }
            set
            {
                this.OnPropertyValueChange(_.ProductId, _ProductId, value);
                this._ProductId = value;
            }
        }

        public String Properties
        {
            get
            {
                return this._Properties;
            }
            set
            {
                this.OnPropertyValueChange(_.Properties, _Properties, value);
                this._Properties = value;
            }
        }

        public Decimal CommissionRate
        {
            get
            {
                return this._CommissionRate;
            }
            set
            {
                this.OnPropertyValueChange(_.CommissionRate, _CommissionRate, value);
                this._CommissionRate = value;
            }
        }

        public String Title
        {
            get
            {
                return this._Title;
            }
            set
            {
                this.OnPropertyValueChange(_.Title, _Title, value);
                this._Title = value;
            }
        }

        public String Nick
        {
            get
            {
                return this._Nick;
            }
            set
            {
                this.OnPropertyValueChange(_.Nick, _Nick, value);
                this._Nick = value;
            }
        }

        public String Picture
        {
            get
            {
                return this._Picture;
            }
            set
            {
                this.OnPropertyValueChange(_.Picture, _Picture, value);
                this._Picture = value;
            }
        }

        public Decimal Price
        {
            get
            {
                return this._Price;
            }
            set
            {
                this.OnPropertyValueChange(_.Price, _Price, value);
                this._Price = value;
            }
        }

        public String ClickUrl
        {
            get
            {
                return this._ClickUrl;
            }
            set
            {
                this.OnPropertyValueChange(_.ClickUrl, _ClickUrl, value);
                this._ClickUrl = value;
            }
        }

        public Decimal Commission
        {
            get
            {
                return this._Commission;
            }
            set
            {
                this.OnPropertyValueChange(_.Commission, _Commission, value);
                this._Commission = value;
            }
        }

        public Int64 CommissionCount
        {
            get
            {
                return this._CommissionCount;
            }
            set
            {
                this.OnPropertyValueChange(_.CommissionCount, _CommissionCount, value);
                this._CommissionCount = value;
            }
        }

        public Decimal CommissionVolume
        {
            get
            {
                return this._CommissionVolume;
            }
            set
            {
                this.OnPropertyValueChange(_.CommissionVolume, _CommissionVolume, value);
                this._CommissionVolume = value;
            }
        }

        public String ShopClickUrl
        {
            get
            {
                return this._ShopClickUrl;
            }
            set
            {
                this.OnPropertyValueChange(_.ShopClickUrl, _ShopClickUrl, value);
                this._ShopClickUrl = value;
            }
        }

        public Int32 SellerCreditScore
        {
            get
            {
                return this._SellerCreditScore;
            }
            set
            {
                this.OnPropertyValueChange(_.SellerCreditScore, _SellerCreditScore, value);
                this._SellerCreditScore = value;
            }
        }

        public String ItemLocation
        {
            get
            {
                return this._ItemLocation;
            }
            set
            {
                this.OnPropertyValueChange(_.ItemLocation, _ItemLocation, value);
                this._ItemLocation = value;
            }
        }

        public Int32 Volume
        {
            get
            {
                return this._Volume;
            }
            set
            {
                this.OnPropertyValueChange(_.Volume, _Volume, value);
                this._Volume = value;
            }
        }

        public DateTime Modified
        {
            get
            {
                return this._Modified;
            }
            set
            {
                this.OnPropertyValueChange(_.Modified, _Modified, value);
                this._Modified = value;
            }
        }

        public DateTime ListTime
        {
            get
            {
                return this._ListTime;
            }
            set
            {
                this.OnPropertyValueChange(_.ListTime, _ListTime, value);
                this._ListTime = value;
            }
        }

        public DateTime DelistTime
        {
            get
            {
                return this._DelistTime;
            }
            set
            {
                this.OnPropertyValueChange(_.DelistTime, _DelistTime, value);
                this._DelistTime = value;
            }
        }

        public DateTime AddTime
        {
            get
            {
                return this._AddTime;
            }
            set
            {
                this.OnPropertyValueChange(_.AddTime, _AddTime, value);
                this._AddTime = value;
            }
        }

        public DateTime UpdateTime
        {
            get
            {
                return this._UpdateTime;
            }
            set
            {
                this.OnPropertyValueChange(_.UpdateTime, _UpdateTime, value);
                this._UpdateTime = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override MySoft.Data.Table GetTable()
        {
            return new MySoft.Data.Table<_Merchandise>("co_Merchandise");
        }

        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        protected override MySoft.Data.Field[] GetPrimaryKeyFields()
        {
            return new MySoft.Data.Field[] {
    					_.Id,
    					_.CatalogId};
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override MySoft.Data.Field[] GetFields()
        {
            return new MySoft.Data.Field[] {
    					_.Id,
    					_.CatalogId,
    					_.ProductId,
    					_.Properties,
    					_.CommissionRate,
    					_.Title,
    					_.Nick,
    					_.Picture,
    					_.Price,
    					_.ClickUrl,
    					_.Commission,
    					_.CommissionCount,
    					_.CommissionVolume,
    					_.ShopClickUrl,
    					_.SellerCreditScore,
    					_.ItemLocation,
    					_.Volume,
    					_.Modified,
    					_.ListTime,
    					_.DelistTime,
    					_.AddTime,
    					_.UpdateTime};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
    					this._Id,
    					this._CatalogId,
    					this._ProductId,
    					this._Properties,
    					this._CommissionRate,
    					this._Title,
    					this._Nick,
    					this._Picture,
    					this._Price,
    					this._ClickUrl,
    					this._Commission,
    					this._CommissionCount,
    					this._CommissionVolume,
    					this._ShopClickUrl,
    					this._SellerCreditScore,
    					this._ItemLocation,
    					this._Volume,
    					this._Modified,
    					this._ListTime,
    					this._DelistTime,
    					this._AddTime,
    					this._UpdateTime};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(MySoft.Data.IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.Id)))
            {
                this._Id = reader.GetInt64(_.Id);
            }
            if ((false == reader.IsDBNull(_.CatalogId)))
            {
                this._CatalogId = reader.GetInt64(_.CatalogId);
            }
            if ((false == reader.IsDBNull(_.ProductId)))
            {
                this._ProductId = reader.GetInt64(_.ProductId);
            }
            if ((false == reader.IsDBNull(_.Properties)))
            {
                this._Properties = reader.GetString(_.Properties);
            }
            if ((false == reader.IsDBNull(_.CommissionRate)))
            {
                this._CommissionRate = reader.GetDecimal(_.CommissionRate);
            }
            if ((false == reader.IsDBNull(_.Title)))
            {
                this._Title = reader.GetString(_.Title);
            }
            if ((false == reader.IsDBNull(_.Nick)))
            {
                this._Nick = reader.GetString(_.Nick);
            }
            if ((false == reader.IsDBNull(_.Picture)))
            {
                this._Picture = reader.GetString(_.Picture);
            }
            if ((false == reader.IsDBNull(_.Price)))
            {
                this._Price = reader.GetDecimal(_.Price);
            }
            if ((false == reader.IsDBNull(_.ClickUrl)))
            {
                this._ClickUrl = reader.GetString(_.ClickUrl);
            }
            if ((false == reader.IsDBNull(_.Commission)))
            {
                this._Commission = reader.GetDecimal(_.Commission);
            }
            if ((false == reader.IsDBNull(_.CommissionCount)))
            {
                this._CommissionCount = reader.GetInt64(_.CommissionCount);
            }
            if ((false == reader.IsDBNull(_.CommissionVolume)))
            {
                this._CommissionVolume = reader.GetDecimal(_.CommissionVolume);
            }
            if ((false == reader.IsDBNull(_.ShopClickUrl)))
            {
                this._ShopClickUrl = reader.GetString(_.ShopClickUrl);
            }
            if ((false == reader.IsDBNull(_.SellerCreditScore)))
            {
                this._SellerCreditScore = reader.GetInt32(_.SellerCreditScore);
            }
            if ((false == reader.IsDBNull(_.ItemLocation)))
            {
                this._ItemLocation = reader.GetString(_.ItemLocation);
            }
            if ((false == reader.IsDBNull(_.Volume)))
            {
                this._Volume = reader.GetInt32(_.Volume);
            }
            if ((false == reader.IsDBNull(_.Modified)))
            {
                this._Modified = reader.GetDateTime(_.Modified);
            }
            if ((false == reader.IsDBNull(_.ListTime)))
            {
                this._ListTime = reader.GetDateTime(_.ListTime);
            }
            if ((false == reader.IsDBNull(_.DelistTime)))
            {
                this._DelistTime = reader.GetDateTime(_.DelistTime);
            }
            if ((false == reader.IsDBNull(_.AddTime)))
            {
                this._AddTime = reader.GetDateTime(_.AddTime);
            }
            if ((false == reader.IsDBNull(_.UpdateTime)))
            {
                this._UpdateTime = reader.GetDateTime(_.UpdateTime);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(_Merchandise).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static MySoft.Data.AllField All = new MySoft.Data.AllField<_Merchandise>();

            /// <summary>
            /// 字段名：Id - 数据类型：Int64
            /// </summary>
            public static MySoft.Data.Field Id = new MySoft.Data.Field<_Merchandise>("Id");

            /// <summary>
            /// 字段名：CatalogId - 数据类型：Int64
            /// </summary>
            public static MySoft.Data.Field CatalogId = new MySoft.Data.Field<_Merchandise>("CatalogId");

            /// <summary>
            /// 字段名：ProductId - 数据类型：Int64
            /// </summary>
            public static MySoft.Data.Field ProductId = new MySoft.Data.Field<_Merchandise>("ProductId");

            /// <summary>
            /// 字段名：Properties - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Properties = new MySoft.Data.Field<_Merchandise>("Properties");

            /// <summary>
            /// 字段名：CommissionRate - 数据类型：Decimal
            /// </summary>
            public static MySoft.Data.Field CommissionRate = new MySoft.Data.Field<_Merchandise>("CommissionRate");

            /// <summary>
            /// 字段名：Title - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Title = new MySoft.Data.Field<_Merchandise>("Title");

            /// <summary>
            /// 字段名：Nick - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Nick = new MySoft.Data.Field<_Merchandise>("Nick");

            /// <summary>
            /// 字段名：Picture - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field Picture = new MySoft.Data.Field<_Merchandise>("Picture");

            /// <summary>
            /// 字段名：Price - 数据类型：Decimal
            /// </summary>
            public static MySoft.Data.Field Price = new MySoft.Data.Field<_Merchandise>("Price");

            /// <summary>
            /// 字段名：ClickUrl - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field ClickUrl = new MySoft.Data.Field<_Merchandise>("ClickUrl");

            /// <summary>
            /// 字段名：Commission - 数据类型：Decimal
            /// </summary>
            public static MySoft.Data.Field Commission = new MySoft.Data.Field<_Merchandise>("Commission");

            /// <summary>
            /// 字段名：CommissionCount - 数据类型：Int64
            /// </summary>
            public static MySoft.Data.Field CommissionCount = new MySoft.Data.Field<_Merchandise>("CommissionCount");

            /// <summary>
            /// 字段名：CommissionVolume - 数据类型：Decimal
            /// </summary>
            public static MySoft.Data.Field CommissionVolume = new MySoft.Data.Field<_Merchandise>("CommissionVolume");

            /// <summary>
            /// 字段名：ShopClickUrl - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field ShopClickUrl = new MySoft.Data.Field<_Merchandise>("ShopClickUrl");

            /// <summary>
            /// 字段名：SellerCreditScore - 数据类型：Int32
            /// </summary>
            public static MySoft.Data.Field SellerCreditScore = new MySoft.Data.Field<_Merchandise>("SellerCreditScore");

            /// <summary>
            /// 字段名：ItemLocation - 数据类型：String
            /// </summary>
            public static MySoft.Data.Field ItemLocation = new MySoft.Data.Field<_Merchandise>("ItemLocation");

            /// <summary>
            /// 字段名：Volume - 数据类型：Int32
            /// </summary>
            public static MySoft.Data.Field Volume = new MySoft.Data.Field<_Merchandise>("Volume");

            /// <summary>
            /// 字段名：Modified - 数据类型：DateTime
            /// </summary>
            public static MySoft.Data.Field Modified = new MySoft.Data.Field<_Merchandise>("Modified");

            /// <summary>
            /// 字段名：ListTime - 数据类型：DateTime
            /// </summary>
            public static MySoft.Data.Field ListTime = new MySoft.Data.Field<_Merchandise>("ListTime");

            /// <summary>
            /// 字段名：DelistTime - 数据类型：DateTime
            /// </summary>
            public static MySoft.Data.Field DelistTime = new MySoft.Data.Field<_Merchandise>("DelistTime");

            /// <summary>
            /// 字段名：AddTime - 数据类型：DateTime
            /// </summary>
            public static MySoft.Data.Field AddTime = new MySoft.Data.Field<_Merchandise>("AddTime");

            /// <summary>
            /// 字段名：UpdateTime - 数据类型：DateTime
            /// </summary>
            public static MySoft.Data.Field UpdateTime = new MySoft.Data.Field<_Merchandise>("UpdateTime");
        }
    }
}
